// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'BatchID',
        footer: "Foots",
        cnName: '生产任务管理',
        name: 'productionbatchesview',
        newTabEdit: false,
        url: "/productionbatchesview/",
        sortName: "BatchID"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"BatchCode":"","ProductID":"","ProductCode":"","StartPartNum":"","Quantity":"","Status":"","ProductName":"","DrawNo":"","Memo":""};
    const editFormOptions = [[{"title":"批次编码","field":"BatchCode","colSize":3},
                               {"title":"产品ID，外键关联产品表","required":true,"field":"ProductID","type":"number"},
                               {"title":"物料编码","required":true,"field":"ProductCode","colSize":3,"type":"selectTable"},
                               {"title":"起始件号","required":true,"field":"StartPartNum","type":"number"},
                               {"title":"投产数量/pcs","required":true,"field":"Quantity","type":"number"}],
                              [{"dataKey":"订单状态","data":[],"title":"作业状态","required":true,"field":"Status","disabled":true,"type":"select"},
                               {"title":"物料名称","field":"ProductName","disabled":true},
                               {"title":"图号","field":"DrawNo","disabled":true},
                               {"title":"备注","field":"Memo","colSize":4}]];
    const searchFormFields = {"Status":"","BatchCode":"","ProductCode":"","Operators":"","StartDate":[null,null]};
    const searchFormOptions = [[{"dataKey":"订单状态","data":[],"title":"作业状态","field":"Status","type":"select"},{"title":"批次编码","field":"BatchCode"}],[{"title":"物料编码","field":"ProductCode"},{"title":"操作人员","field":"Operators"},{"title":"开始时间","field":"StartDate","type":"range"}]];
    const columns = [{field:'Status',title:'作业状态',type:'int',bind:{ key:'订单状态',data:[]},sort:true,width:65,readonly:true,require:true,align:'left'},
                       {field:'BatchID',title:'主键，自增ID',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'BatchCode',title:'批次编码',type:'string',width:110,align:'left'},
                       {field:'OrderID',title:'订单ID，外键关联生产订单表',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'ProductID',title:'产品ID，外键关联产品表',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'ProductCode',title:'物料编码',type:'string',width:110,require:true,align:'left'},
                       {field:'ProductName',title:'物料名称',type:'string',width:110,readonly:true,align:'left'},
                       {field:'DrawNo',title:'图号',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'StartPartNum',title:'起始件号',type:'int',width:55,require:true,align:'left'},
                       {field:'Quantity',title:'投产数量/pcs',type:'decimal',width:110,require:true,align:'left'},
                       {field:'FinishQuantity',title:'完工数量/pcs',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Operators',title:'操作人员',type:'string',width:110,align:'left'},
                       {field:'OldBatchCode',title:'旧的批次号',type:'string',width:110,hidden:true,align:'left'},
                       {field:'StartDate',title:'开始时间',type:'datetime',width:110,require:true,align:'left'},
                       {field:'EndDate',title:'更新时间',type:'datetime',sort:true,width:110,align:'left'},
                       {field:'Memo',title:'备注',type:'string',width:110,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}